package com.qk.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.common.PageResult;
import com.qk.dto.OperateDto;
import com.qk.entity.OperateLog;
import com.qk.mapper.OperateMapper;
import com.qk.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class OperateLogServiceImpl extends ServiceImpl<OperateMapper, OperateLog> implements OperateLogService {
    @Autowired
    private OperateMapper operateMapper;
    @Override
    public PageResult<OperateLog> operateLogList(OperateDto operateDto) {
        log.info("operateDto: {}", operateDto);
        Page<OperateLog> page = new Page<>(operateDto.getPage(), operateDto.getPageSize());
        Page<OperateLog> operateLogPage = operateMapper.operateLogList(page, operateDto);
        return new PageResult<>(operateLogPage.getTotal(), operateLogPage.getRecords());
    }
}
